<%--
  Created by IntelliJ IDEA.
  User: empty
  Date: 2025/5/21
  Time: 21:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>社区登录</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Arial', sans-serif;
        }

        body {
            background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            padding: 20px;
            font-family: 'Arial', sans-serif;
        }

        .header {
            width: 100%;
            max-width: 800px;
            margin-bottom: 40px;
        }

        .header h1 {
            color: #343a40;
            font-size: 28px;
            text-align: center;
            margin: 0;
            padding: 0;
        }

        #app {
            background-color: white;
            border-radius: 15px;
            box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
            padding: 40px 50px;
            width: 100%;
            max-width: 450px;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        #app:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
        }

        h2 {
            color: #343a40;
            font-size: 24px;
            margin-bottom: 20px;
            border-left: 4px solid #4a89dc;
            padding-left: 12px;
            margin-left: -12px;
        }

        form {
            display: grid;
            grid-gap: 25px;
            width: 100%;
        }

        label {
            display: flex;
            flex-direction: column;
        }

        label span {
            font-size: 14px;
            color: #6c757d;
            margin-bottom: 8px;
            font-weight: 500;
        }

        input {
            padding: 16px 20px;
            border: 1px solid #e0e3e8;
            border-radius: 8px;
            font-size: 16px;
            transition: all 0.3s ease;
            background-color: #f9fafc;
        }

        input:focus {
            outline: none;
            border-color: #4a89dc;
            background-color: white;
            box-shadow: 0 0 0 2px rgba(74, 137, 220, 0.2);
        }

        .button-group {
            grid-gap: 18px;
            margin-top: 10px;
        }

        button {
            padding: 16px 20px;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .login-btn {
            background-color: #4a89dc;
            color: white;
            box-shadow: 0 4px 12px rgba(74, 137, 220, 0.15);
        }

        .login-btn:hover {
            background-color: #3a7bd5;
            box-shadow: 0 6px 18px rgba(74, 137, 220, 0.2);
        }

        .register-btn {
            background-color: #28a745;
            color: white;
            box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15);
        }

        .register-btn:hover {
            background-color: #218838;
            box-shadow: 0 6px 18px rgba(40, 167, 69, 0.2);
        }

        .message {
            margin-top: 30px;
            padding: 14px 20px;
            border-radius: 8px;
            font-size: 14px;
            width: 100%;
            max-width: 450px;
        }

        .message.error {
            background-color: #ffe6e6;
            color: #dc3545;
            border: 1px solid #ffcccc;
        }

        .message.success {
            background-color: #e6f5e9;
            color: #28a745;
            border: 1px solid #d4edda;
        }
    </style>
</head>
<body>
<div class="header">
    <h1>社区登录</h1>
</div>

<div id="app">
    <h2>用户登录</h2>
    <form action="Login-community" method="post">
        <label>
            <span>账号:</span>
            <input type="text" name="username" placeholder="请输入账号" required>
        </label>
        <label>
            <span>密码:</span>
            <input type="password" name="password" placeholder="请输入密码" required>
        </label>
        <button type="submit" class="login-btn">登录</button>
    </form>

    <form action="Login-community" method="get" class="button-group">
        <input type="hidden" name="action" value="register">
        <button type="submit" class="register-btn">注册账号</button>
    </form>
</div>

<div class="message ${message ? (message.startsWith('成功') ? 'success' : 'error') : ''}">
    ${message}
</div>
</body>
</html>

